/*================================================================
*   Copyright (C) 2020 Sangfor Ltd. All rights reserved.
*   
*   文件名称：test.c
*   创 建 者：Ann
*   创建日期：2020年04月18日
*   描    述：
*
================================================================*/

#include <stdio.h>
#include <unistd.h>

int main()
{
    printf("hahahahahahhaha\n");
    int pid = fork();
    if(pid < 0)
    {
        perror("fork");
        return 0;
    }
    else if(pid == 0)
    {
        //child
        printf("i am child %d\n", getpid());
    }
    else
    {
        //father
        printf("i am father %d\n", getpid());
        while(1)
        {
            sleep(1);
        }
        sleep(20);
    }
    printf("hellohello\n");

    return 0;
}
